package com.cskaoyan.shopping.service.impl;

import com.alibaba.fastjson.JSON;
import com.cskaoyan.mall.commons.exception.BizException;
import com.cskaoyan.mall.dto.ItemDto;
import com.cskaoyan.shopping.constants.ShoppingRetCode;
import com.cskaoyan.shopping.converter.ProductConverter;
import com.cskaoyan.shopping.dal.entitys.Item;
import com.cskaoyan.shopping.dal.persistence.ItemMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.IOException;
import java.util.List;

/**
 * @ClassName ISearcherServiceImpl
 * @Description TODO
 * @Author XiaoWJ
 * @Date 2022/9/27 20:31
 **/
@Service
public class ISearcherServiceImpl implements ISearcherService {


    @Autowired
    ItemMapper itemMapper;

    @Autowired
    ProductConverter productConverter;


    @Override
    public List<ItemDto> getAllProductItem() {
        List<Item> items = itemMapper.selectAll();

        return  productConverter.items2ItemDtos(items);

    }
}
